<?php
/**
 * @Name: Account.php
 * @Author: yashuai<1762910894@qq.com>
 */

namespace app\backstage\controller;

use app\common\requests\account\AccountPasswordRequest;
use app\common\services\rbac\LoginServices;

class Account extends BaseController
{

    public function __construct(LoginServices $service)
    {
        $this->service = $service;
    }

    /**
     * @Desc 账号密码登录
     * @param AccountPasswordRequest $request
     * @return \think\response\Json
     * @author yashuai<1762910894@qq.com>
     */
    public function password(AccountPasswordRequest $request)
    {
        $params = $request->getValidationData();
        $result = $this->service->passwordAuth($params);
        return _success($result);
    }

    public function test()
    {
        return _success();
    }

}
